package com.ming.sportdemo.alipay;

import java.util.Random;

public class OrderId {
    /**
     * 订单生成
     * @param length 订单字符部分长度
     * @return 订单号
     */
    public static String createOrder(int length){
        String base = "abcdefghijklmnopqrstuvxyz";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < length; i++) {
            int number = random.nextInt(base.length());
            sb.append(base.charAt(number));
        }
        return sb.toString()+System.currentTimeMillis();
    }

    public static void main(String[] args) {
        System.out.println(createOrder(10));
    }
}
